﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArbolandiaBL
{
    public class ServiceUI
    {
        public List<Picture> GetBanner(BannerType type)
        {
            try
            {
                return new UIBanner().GetBanner(type);
            }
            catch (Exception)
            {

                throw;
            }

        }
        public List<UICategoryResume> GetCategorys()
        {
            try
            {
                return new UICategory().GetCategorys();
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<UISubcategoryResume> GetSubcategorys(Int32 categoryId)
        {
            try
            {
                return new UISubCategory().GetSubcategorys(categoryId);
            }
            catch (Exception)
            {
                throw;
            }

        }
        public List<UIProductsHome> GetOfertasDestacadosHome()
        {
            try
            {
                return new UICategory().GetOfertasDestacadosHome();
            }
            catch (Exception)
            {

                throw;
            }

        }
        public List<UIProductsHome> GetOfertasByCategoria(int idCategory)
        {
            try
            {
                return new UICategory().GetOfertasByCategoria(idCategory);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public UISubcategoryDetail GetSubCategoryDetail(int idSubCategory)
        {
            try
            {
                return new UISubCategory().GetSubCategoryDetail(idSubCategory);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<UIProductResume> GetProductsBySubCategory(int idSubCategory)
        {
            try
            {
                return new UISubCategory().GetProductsBySubCategory(idSubCategory);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<UIProductVariousResume> GetProductsVariousBySubCategory(int idSubCategory)
        {
            try
            {
                return new UISubCategory().GetProductsVariousBySubCategory(idSubCategory);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public UIProductDetail GetProductDetail(int idproduct)
        {
            try
            {
                return new UIProductProvider().GetProductDetail(idproduct);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public UIProductVariousDetail GetProductVariousDetail(int idproduct)
        {
            try
            {
                return new UIProductProvider().GetProductVariousDetail(idproduct);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public UIProductPriceDetail GetProductPriceDetail(Int32 idProductPriceDetail, Int32 productId)
        {
            try
            {
                return new ProductsProvider().GetProductPriceDetail(idProductPriceDetail, productId);
            }
            catch (Exception)
            {

                throw;
            }

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="p1">Name</param>
        /// <param name="p2_1">Price min</param>
        /// <param name="p2_2">Price max</param>
        /// <param name="p3">category</param>
        /// <param name="p4">subcategory</param>
        /// <param name="p5">mesesflora</param>
        /// <param name="p6">color</param>
        /// <param name="p7">altura</param>
        /// <param name="p8">preferencias</param>
        /// <returns></returns>
        public List<UIProductResume> GetAdvancedSearch(string p1, decimal p2_1, decimal p2_2, string p3, string p4, string p5, string p6, string p7, string p8)
        {
            var result = new List<UIProductResume>();
            try
            {
                result = new UIAdvancedSearch().GetAdvancedSearch(p1, p2_1, p2_2, p3, p4, p5, p6, p7, p8);
            }
            catch (Exception)
            {

                throw;
            }
            return result;
        }

    }
}
